<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="enum" uri="http://www.hnluchuan.com/enum" %>

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title>全科信息系统极简版</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="/xh_logo.ico">

    <%@include file="/common/jscss.jsp" %>

</head>
<style>
    .navbar-default {
        box-shadow: 2px 0 4px 1px #ddd;
    }

    <c:if test="${user.type == 2 or user.type == 3}">
    li.nav-header {
        background: #fff;
        padding-bottom: 10px;
    }

    .user-name,
    .nav-header a {
        color: #21A5FA;
    }

    .nav-header a {
        font-weight: normal;
        text-decoration: underline;
    }

    .nav-header p:last-child a {
        margin: 20px 30px 0 0;
    }

    </c:if>

    #content-main {
        height: calc(100% - 45px);
    }

    body.full-height-layout #page-wrapper, body.full-height-layout #wrapper {
        overflow: hidden;
    }

    .roll-right.J_tabExit {
        width: 80px;
    }

    .roll-right.btn-group {
        right: 80px;
    }

    .roll-right.J_tabRight {
        right: 160px;
    }
</style>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<div id="wrapper">
    <!--左侧导航开始-->
    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="nav-close"><i class="fa fa-times-circle"></i>
        </div>
        <div class="sidebar-collapse">
            <ul class="nav" id="side-menu">
                <li class="nav-header">
                    <div class="dropdown profile-element">
                        <c:if test="${user.type == 2}">
                            <p><span class="user-name">${agent.orgName}</span>，欢迎登录</p>
                            <p>当前医生数：<span class="text-danger" id="customerCount">${customerCount}</span></p>
                            <p>账号剩余数量：<span class="text-danger" id="remainPackageCount">${remainPackageCount}</span></p>
                            <p>今日新增医生数：<span class="text-danger" id="newlyEnrolledCount">${newlyEnrolledCount}</span></p>
                            <p>
                                <a class="J_menuItem" href="${ctx }/admin/user/changePassword">修改密码</a>
                                <a href="${ctx }/admin/j_spring_security_logout">安全退出</a>
                            </p>
                        </c:if>
                        <c:if test="${user.type == 3}">
                            <p><span class="user-name">${clinic.name}</span></p>
                            <p>欢迎使用全科信息系统极简版</p>
                            <p>到期时间：<span class="text-danger"><fmt:formatDate value="${expiredDate}"
                                                                              pattern="yyyy-MM-dd"/> </span></p>
                            <p>剩余时间：<span class="text-danger">${restDays}天</span></p>
                            <p>
                                <a class="J_menuItem" href="${ctx }/admin/user/changePassword">修改密码</a>
                                <a href="${ctx }/admin/j_spring_security_logout">安全退出</a>
                            </p>
                        </c:if>
                        <c:if test="${user.type == 1}">
                            <span><img alt="image" class="img-circle" src="${user.headImage }" width="80"/></span>
                            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <span class="clear">
                               <span class="block m-t-xs"><strong class="font-bold">${user.username }</strong></span>
                                <span class="text-muted text-xs block">${enum:list('UserType', user.type)}<b
                                        class="caret"></b></span>
                                </span>
                            </a>
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                <li><a class="J_menuItem" href="${ctx }/admin/user/editHeadImage">修改头像</a>
                                </li>
                                <li><a class="J_menuItem" href="profile.html">个人资料</a>
                                </li>
                                <li><a class="J_menuItem" href="${ctx }/admin/user/changePassword">修改密码</a>
                                </li>
                                <li class="divider"></li>
                                <li><a href="${ctx }/admin/j_spring_security_logout">安全退出</a>
                                </li>
                            </ul>
                        </c:if>
                    </div>
                    <div class="logo-element">LC
                    </div>
                </li>

                <!-- 菜单开始 -->
                <%@include file="index_menu.jsp" %>
                <!-- 菜单结束 -->
            </ul>
        </div>
    </nav>
    <!--左侧导航结束-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row content-tabs">
            <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
            </button>
            <nav class="page-tabs J_menuTabs">
                <div class="page-tabs-content">
                    <a href="javascript:;" class="active J_menuTab" data-id="${ctx}/admin/index/index_v3">首页</a>
                </div>
            </nav>
            <button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i>
            </button>
            <div class="btn-group roll-nav roll-right">
                <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>

                </button>
                <ul role="menu" class="dropdown-menu dropdown-menu-right">
                    <li class="J_tabShowActive"><a>定位当前选项卡</a>
                    </li>
                    <li class="divider"></li>
                    <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
                    </li>
                    <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
                    </li>
                </ul>
            </div>
            <a href="${ctx }/admin/j_spring_security_logout" class="roll-nav roll-right J_tabExit"><i
                    class="fa fa fa-sign-out"></i> 退出登录</a>
        </div>
        <div class="row J_mainContent" id="content-main">
            <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="${ctx}/admin/index/index_v3?v=4.0"
                    frameborder="0" data-id="${ctx}/admin/index/index_v3" seamless></iframe>
        </div>

        <div class="footer">
        </div>
    </div>
    <!--右侧部分结束-->


</div>
<script>
    $(document).ready(function () {
        <c:if test="${not empty param.target}">
        var target = "${param.target}";
        if (target) {
            $('a.J_menuItem[href="${ctx}/admin' + target + '"]').click();
        }
        //$('#')
        </c:if>
        $("#side-menu li.nav-header").next().find("a:first-child:not(.J_menuItem)").trigger("click");
    });
</script>
</body>

</html>